import Taro, {Component} from "@tarojs/taro";
import {View, Image } from "@tarojs/components";
import './authOne.less'
import './authSuccess.less'

import {getRuntime} from "../../utils/common";
import icon_08 from "../../assets/img/icon_08.png";

class AuthSuccess extends Component {
  constructor() {
    super()
  }

  state = { }

  componentWillMount() {
    Taro.setNavigationBarTitle({title: '认证成功'})
  }

  componentDidShow(): void {
    Taro.setNavigationBarTitle({title: '认证成功'})
  }

  link(url: string = '/pages/index/index'): void {
    getRuntime().navigateTo(url)
  }

  render() {
    return (
      <View className='auth auth-success'>
        <View className='pay-success'>
          <View className='pay__header'>
            <Image src={icon_08} className='pay-icon' />
            <View className='pay__title'>恭喜您实名认证成功</View>
            <View className='pay__desc color-theme'>添加信用卡即可还款</View>
          </View>
          <View className='interval' />

          <View className='btn-two-wrap'>
            <View className='btn btn-active' onClick={this.link.bind(this, '/pages/card/creditAdd')}>添加信用卡</View>
            <View className='btn' onClick={this.link.bind(this, '/pages/index/index')}>返回首页</View>
          </View>
        </View>
      </View>
    )
  }
}

export default AuthSuccess
